<template lang="pug">
  .tabContent
    s-table(
      ref="table"
      reqUrl=""
      :column="column"
      :queryPropsParams="{}"
    )
      template(slot="action" slot-scope="text, scope")
        el-link(@click="() => modalHandle({ id: scope.id, type: 'contrast', title: scope.childrenName })" type="warning") 对比
        el-link(@click="() => modalHandle({ id: scope.id, type: 'echarts', title: scope.childrenName })" type="success") 图表/查看
      el-dialog(
        :title="modalObj.title"
        :visible="modalObj.visible"
        width="640px"
        append-to-body
        center
        destroy-on-close
        v-el-drag-dialog
        @close="modalHandle()"
      )
</template>
<script>
import { column } from './config.js'

export default {
  name: 'BodyMeasure',
  data () {
    return {
      column,
      modalObj: {
        title: '',
        visible: false,
        id: '',
        type: ''
      }
    }
  },
  methods: {
    // 图表/查看
    modalHandle ({ title, id, type }) {
      console.log(id)
      this.modalObj = {
        title: title || '',
        type: type || '',
        id: id || '',
        visible: !!type
      }
    }
  }
}

</script>
